package org.edu.modules.growth.config;

import lombok.Getter;


@Getter
public enum TrainLevelEnum {

    TYPE1("国家级",1),
    TYPE2("省级",2),
    TYPE3("市级",3),
    TYPE4("校级",4);
    private final String typeName;

    private final int typeVal;

    TrainLevelEnum(String typeName, int typeVal) {
        this.typeName = typeName;
        this.typeVal = typeVal;
    }


    //通过vale-获取name
    public static String getNameByValue(Integer value) {
        if( value != null ){
            for (TrainLevelEnum v : TrainLevelEnum.values()) {
                if (value == v.getTypeVal()) {
                    return v.getTypeName();
                }
            }
        }
        return null ;
    }


}
